﻿using System.Linq;
using Stimulus360.Models.Cms;

namespace Stimulus360.Repositories.Interfaces
{
    /// <summary>
    ///     This interface is reponsible for interaction with the CMS DB which stores
    ///     Project Photos and documents.
    /// </summary>
    public interface ICmsRepository
    {
        /// <summary>
        ///     Method to add a project photo
        /// </summary>
        /// <param name="photo">
        ///     The Photo to be added
        /// </param>
        void AddPhoto(ProjectPhoto photo);

        /// <summary>
        ///     Method to retrieve all the photos for the given project
        /// </summary>
        /// <param name="projectId">
        ///     Project for which photos need to be retrieved
        /// </param>
        /// <returns>
        ///     List of photos
        /// </returns>
        IQueryable<ProjectPhoto> GetPhotos(int projectId);

        /// <summary>
        ///     Method to get the specified photo 
        /// </summary>
        /// <param name="photoId">
        ///     The photo to be retrieved
        /// </param>
        /// <returns>
        ///     Photo corresponding to the photoId
        /// </returns>
        ProjectPhoto FindPhotoById(int photoId);

        /// <summary>
        ///     Method to add a document to a project
        /// </summary>
        /// <param name="document">
        ///     The document to be added
        /// </param>
        void AddDocument(ProjectDocument document);

        /// <summary>
        ///     Method to retrieve all documents for the given project
        /// </summary>
        /// <param name="projectId">
        ///     Project for which documents are to be retrieved
        /// </param>
        /// <returns>
        ///     List of project documents.
        /// </returns>
        IQueryable<ProjectDocument> GetDocuments(int projectId);

        /// <summary>
        ///     Method to get a specific document 
        /// </summary>
        /// <param name="documentId">
        ///     Document to be retrieved
        /// </param>
        /// <returns>
        ///     Document corresponding to the given Document ID
        /// </returns>
        ProjectDocument FindDocumentById(int documentId);
    }
}
